n=int(input())
kmax=0
while n!=0:
    k=n%10
    kmax=max(kmax,k)
    n=n//10
print(kmax)